package com.joysuch.wwyt.api.dataaccess.bean;

import com.joysuch.wwyt.core.enums.RiskLevels;
import com.joysuch.wwyt.risk.entity.RiskDistrict;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author ZhangDong
 * @Date 2020/8/20 10:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RiskAreaBean {

    private String RegionCode;//编号
    private String RegionName;//区域名称
    private String Grade;//级别  红、橙、黄、 蓝

    public RiskAreaBean(RiskDistrict district){
        this.RegionCode=district.getCode();
        this.RegionName=district.getName();
        this.Grade = RiskLevels.findRiskColorByCode(district.getRiskLevel());
    }
}

